class GroupsToDisciplines < ActiveRecord::Migration
  def self.up
    ActiveRecord::Base.transaction do
      rename_table :groups, :disciplines
      rename_column :memberships, :group_id, :discipline_id
      rename_column :posts, :group_id, :discipline_id
    end
  end

  def self.down
    ActiveRecord::Base.transaction do
      rename_table :disciplines, :groups
      rename_column :memberships, :discipline_id, :group_id
      rename_column :posts, :discipline_id, :group_id
    end
  end
end
